package com.hero.content.controller;

import com.hero.content.model.pojo.CourseCategory;
import com.hero.content.service.CourseCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 课程分类 前端控制器
 * </p>
 * /
 *
 * @author itcast
 */
@Slf4j
@RestController
//@RequestMapping("content")
public class CourseCategoryController {

    @Autowired
    private CourseCategoryService courseCategoryService;

    @GetMapping("course-category/tree-nodes")
    public List<CourseCategory> selectAllCategory() {
        return courseCategoryService.selectAllCategoryAndChildrens();
    }
}